package com.ms.game.invitefriend.async;

import com.ms.player.Player;
import com.xpec.c4.game.utility.GUID;
import com.xpec.c4.service.module.task.TaskAsyncCommand;

public class InsertInviteCodeDCLAsync extends TaskAsyncCommand {

	/**
	 * 角色ID
	 */
	public Player player;
	
	/**
	 * sessionID
	 */
	public GUID sessionId;
	
	public int messageType;
	@Override
	public void asyncExecute() throws Exception {
//		SGetInviteCodeResponse response = new SGetInviteCodeResponse();
//		
//		Session session = HibernateManager.getSession();
//		Query query = session.createQuery("From InviteCodeModel Where (playerId = :ID and type = :TYPE1) or (playerId = :ID and type = :TYPE2)");
//		query.setParameter("ID", player.getGuid().toString());
//		query.setParameter("TYPE1", InviteCodeType.NEW_INVITE_CODE);
//		query.setParameter("TYPE2", InviteCodeType.DISTRIBUTOR_INVITE_CODE);
//		List<InviteCodeModel> models = (List<InviteCodeModel>)query.list();
//		HibernateManager.endSession();
//		ArrayList<InviteCodeData> playerInviteCodeDatas = new ArrayList<InviteCodeData>();
//		for (InviteCodeModel inviteCodeModel : models) {
//			InviteCodeData data = new InviteCodeData();
//			data.InviteCode = inviteCodeModel.getInviteCode();
//			data.uselimit = inviteCodeModel.getUpperLimit();
//
//			switch (inviteCodeModel.getType()) {
//			case NEW_INVITE_CODE:
//				data.usedNum = inviteCodeModel.isHaveBeenUsed()?1:0;
//				
//				playerInviteCodeDatas.add(data);
//				break;
//			case DISTRIBUTOR_INVITE_CODE:
//				data.usedNum = InviteFriendDAO.getInviteCodeUsedNum(inviteCodeModel.getInviteCode());
//				response.distributorInviteCodeData = data;
//				break;
//			}
//		}
//				
//		response.playerInviteCodeDatas = playerInviteCodeDatas;
//		response.playerType = player.getPlayerIdentityType();
//		response.errorCode = ErrorCode.SUCCESS;
//		MessageAction.sendMessage(sessionId, messageType, response);


	}
	
	@Override
	public void execute() throws Exception {
		
	}
}
